package com.glory.hikvisionmobile.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.glory.hikvisionmobile.R;
import com.glory.hikvisionmobile.bean.LotSplitOrAdd.LotAddBean;

import java.util.List;

public class LotAddListAdapter extends BaseQuickAdapter<LotAddBean, BaseViewHolder> {
    private StringBuffer sb;
    public LotAddListAdapter(@Nullable List<LotAddBean> data) {
        super(R.layout.adapter_param_list,data);
        sb = new StringBuffer();
    }

    @Override
    protected void convert(BaseViewHolder helper, LotAddBean item) {
        helper.setText(R.id.tvItem1,item.getLotId());
        helper.setText(R.id.tvItem2,item.getMainQty());
        helper.setText(R.id.tvItem3,item.getStepDesc());
        helper.setText(R.id.tvItem4,item.getPartDesc());
        helper.setText(R.id.tvItem5,item.getRecipeName());
        sb.append(item.getLotId() + ";");
    }

    public String getMergeLotID(){
        return sb.toString();
    }

    public void setMergeLotID(){
        int length = sb.length();
        this.sb.delete(0,length);
    }
}
